<!--
 * @Author: coman
 * @LastEditors: coman
 * @Date: 2020-06-18 15:38:30
 * @motto: No pain,No gain
 * @LastEditTime: 2020-06-18 20:03:16
--> 
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
   <script>
    /*    var num1 = [4,3,2,7,8,2,3,1];
       num1.sort(function(a,b){
           return a-b;
       })
       min=num1[0];
       max=num1[num1.length-1]
       var j=1;
       while(j<min){
           num1.push(j);
           j++;
       }
      for(var i=0;i<num.length;i++){
          var k=min;
          if(k!=num[i])
      }
       console.log(res); */
       var num1=[4,3,2,7,8,2,3,1];
       var arr = new Array();
       console.log(...num1);

       for(var i=1;i<=Math.max(...num1);i++){
           if(!num1.includes(i)){
                    arr.push(i);
           }
       }
       console.log(arr);
       
       
   </script> 
</body>
</html>